<%@ page language="java" import="java.util.*,java.sql.*" pageEncoding="UTF-8"%>


        <form id="form1" name="form1" method="post" action="bcyhxx.jsp">
            <table style="background-color: #008B8B;color: white;" width="600"  border="2" align="center" cellspacing="0" cellpadding="0">
                <tr height="40">
                    <td colspan="2" align="center">用户信息</td>
                </tr>
                <tr height="40">
                    <td align="center" >帐号</td>
          
<%
String name;
 ResultSet rs=null;
  Connection con=null;
  int id=Integer.valueOf(request.getParameter("id"));
  try{
  Class.forName("com.mysql.jdbc.Driver");
  String url="jdbc:mysql://localhost:3306/test";
  String username="root";
  String password="root";
  con=DriverManager.getConnection(url, username, password);
  String sql="select * from users where id="+id;
  Statement sm=con.createStatement();
  rs=sm.executeQuery(sql);
  if(rs.next()){
%>
                    <td align="center"><%=rs.getString("username") %></td>
                    
<% 
}else{out.print("NO");}
 rs.close();sm.close();con.close();
  }catch(ClassNotFoundException e){e.printStackTrace();}catch(SQLException e){e.printStackTrace();}
%>
                    
                    
                    
                </tr>
                <tr height="40">
                    <td align="center" >姓名</td>
                    <td align="center"><label>
                    <input name="xm" type="text"  id="xm" size="16" />
            </label></td>
    </tr>
    <tr height="40">
      <td height="35" align="center" >性别</td>
      <td align="center"><p>
        <label>
          <span >
          <input type="radio" name="xb" value="男" id="xb_0" checked="checked" />
          男</span></label>
        <span >
        <label>
          <input type="radio" name="xb" value="女" id="xb_1" />
          女</label>
        </span><br />
      </p></td>
    </tr>
    <tr height="40">
      <td align="center" >出生日期</td>
      <td align="center"><label>
        <input name="csrq" type="date"  id="csrq" />
      </label></td>
    </tr>
    <tr height="40">
      <td colspan="2" align="center"><label>
        <input name="bc" type="submit"  id="bc" value="保存" />
        <input name="cz" type="reset"  id="cz" value="重置" />
      </label></td>
    </tr>
  </table>
</form>
	
